package com.txl.cn.lc

import org.apache.spark.{SparkConf, SparkContext}

/**
  * Created by txl on 2018/3/9.
  */
object Demo {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName("lc").setMaster("local[*]")
    val sc = new SparkContext(conf)
    val data = sc.textFile("hdfs://txl:9000/wordcount/lc.txt")
    val res = data.flatMap(_.split(",")).map((_,1)).reduceByKey(_+_)
    res.saveAsTextFile(args(1))




  }
}
